package io.datajek.springbasics.movierecommendersystem.lesson11;

import io.datajek.springbasics.movierecommendersystem.lesson2.Filter;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import java.util.logging.Logger;

@Component
public class ContentBasedFilter implements Filter {
    private Logger logger ;
    public ContentBasedFilter(){
        super();
        logger.info("In ContentBasedFilter postConstruct method");
    }
    @PostConstruct
    private void postConstruct(){
        //将电影加载到缓存中
        logger.info("In ContentBasedFilter postConstruct method");
    }
    @PreDestroy
    private void perDestroy(){
        //从缓存中清除电影
        logger.info("In ContentBasedFilter preDestroy method");
    }
    //getRecommendations将一部电影作为输入，并返回类似电影的列表。
    public String[] getRecommendations(String movie) {

        //计算电影之间的相似度


        //返回电影推荐
        return new String[] {"Happy Feet", "Ice Age", "Shark Tale"};
    }
}
